

def foo(n):
# 正三角
    for i in range(1, n+1 ):
        print('   ' * (n-i), end='')
        for ii in range(i, 0, -1):
            print('{:<3}'.format(ii), end='')
        print('')

    print('-'* 20)

# 倒三角
    for i in range(n, 0, -1):
        print('   ' * (n-i), end='')
        for ii in range(i, 0, -1):
            print('{:<3}'.format(ii), end='')
        print('')

foo(13)


# 做得很好，不过，间隙控制的不是很好
